<?php /*a:3:{s:58:"E:\project\blog\application/index/view\index\register.html";i:1521457902;s:56:"E:\project\blog\application/index/view\public\_head.html";i:1521459074;s:56:"E:\project\blog\application/index/view\public\_foot.html";i:1521456581;}*/ ?>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="keywords" content="梦中PHP,DreamPHP,Thinkphp,Laravel,PHP">
    <meta name="description" content="梦中PHP，英文名DreamPHP，是一个专注于ThinkPHP和Laravel开发的教程网站！">
    <title><?php echo htmlentities((isset($webInfo['webname']) && ($webInfo['webname'] !== '')?$webInfo['webname']:'梦中PHP——拜师QQ:305530751')); ?>——拜师QQ:305530751</title>
    <link rel="shortcut icon" href="/static/index/img/logo.jpg" type="image/x-icon">
    <link rel="stylesheet" href="/static/index/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/index/css/main.css">
</head>
<body>
<nav class="navbar navbar-default navbar-inverse navbar-static-top navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <a href="<?php echo url('index/index/index'); ?>" class="navbar-brand"><?php echo htmlentities($webInfo['webname']); ?></a>
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menu">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="navbar-menu collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="<?php echo url('index/index/index'); ?>">首页</a></li>
                <?php if(is_array($cateList) || $cateList instanceof \think\Collection || $cateList instanceof \think\Paginator): $i = 0; $__LIST__ = $cateList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <li><a href="<?php echo url('index/index/index', ['id' => $vo['id']]); ?>"><?php echo htmlentities($vo['catename']); ?></a></li>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <?php if(!session('?username')): ?>
                <li><a href="<?php echo url('index/index/login'); ?>">登录</a></li>
                <li><a href="<?php echo url('index/index/register'); ?>">注册</a></li>
                <?php else: ?>
                <li><a href="#"><?php echo session('username'); ?></a></li>
                <li><a href="#" id="loginout">退出</a></li>
                <?php endif; ?>
                <li><a href="javascript:;" id="post">投稿中心</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container form">
    <h1>用户注册</h1>
    <form action="">
        <div class="form-group">
            <label for="username" class="control-label">用户名</label>
            <input type="text" class="form-control" id="username" name="username" placeholder="用户名">
        </div>
        <div class="form-group">
            <label for="password" class="control-label">密码</label>
            <input type="password" class="form-control" id="password" name="password" placeholder="密码">
        </div>
        <div class="form-group">
            <label for="conpass" class="control-label">确认密码</label>
            <input type="password" class="form-control" id="conpass" name="conpass" placeholder="确认密码">
        </div>
        <div class="form-group">
            <label for="verify" class="control-label">验证码</label>
            <div class="input-group">
                <input type="text" class="form-control" id="verify" name="verify" placeholder="验证码">
                <span class="input-group-addon"><img src="<?php echo captcha_src(); ?>" onclick="this.src='<?php echo captcha_src(); ?>'" alt="验证码"></span>
            </div>
        </div>
        <div class="form-group">
            <button id="register" class="btn btn-primary btn-block" type="submit">注册</button>
        </div>
    </form>
</div>

<div class="footer">
    <p>Copyright 2018 <?php echo htmlentities($webInfo['copyright']); ?> All Rights Reserved</p>
</div>

<script src="/static/index/js/jquery-3.3.1.min.js"></script>
<script src="/static/index/js/bootstrap.min.js"></script>
<script src="/static/lib/layer/layer.js"></script>
<script>
    $('#post').click(function () {
        layer.open({
            title:'投稿中心暂时关闭',
            content:'正在筹备收益算法！',
            icon:5,
            anim:6
        });
        return false;
    });

    $('#loginout').click(function () {
        $.ajax({
            url:"<?php echo url('index/index/loginout'); ?>",
            type:'post',
            dataType:'json',
            success:function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                        icon:6,
                        time:2000
                    }, function () {
                        location.href = data.url;
                    });
                }else {
                    layer.open({
                        title:'退出失败',
                        content:data.msg,
                        icon:5,
                        anim:6
                    });
                }
            }
        });
        return false;
    });
</script>
<script>
    $('#register').click(function () {
        $.ajax({
            url:"<?php echo url('index/index/register'); ?>",
            type:'post',
            data:$('form').serialize(),
            dataType:'json',
            success:function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                        icon:6,
                        time:2000
                    }, function () {
                        location.href = data.url;
                    });
                }else {
                    layer.open({
                        title:'注册失败',
                        content:data.msg,
                        icon:5,
                        anim:6
                    });
                }
            }
        });
        return false;
    });
</script>
</body>
</html>